<script></script>
<h3><B>小区信息管理</B></h3>
<br>
<a ng-click="addCommunity()" class="btn-primary btn-sm nodecoration">添加小区</a>


<br>
<br>
<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>
                <th>名称</th>
                <th>地址</th>
                <th>户数</th>
                <th>邮编</th>
                <th>常用电话</th>
                <th>生效日期</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="community in communityLabelList.data">

                <td width="200">{{community.communityName}}</td>
                <td width="300">{{community.communityAddress}}</td>
                <td>{{community.households}}</td>
                <td>{{community.communityPostCode}}</td>
                <td width="500">
                    <div ng-repeat="m in community.phoneList">
                        <input ng-model="m.name" data-provide="typeahead" disabled/><input ng-model="m.phoneNo"
                                                                                           data-provide="typeahead"
                                                                                           disabled/>
                    </div>
                </td>
                <td width="100">{{community.dateEffective | date:'yyyy-MM-dd'}}</td>
                <td>
                    <a class="btn btn-secondary btn-xs" ng-click="gotoCommunityEditPage(community.objId)">编辑</a>
                    <a ng-show="community.isValid == false" class="btn btn-primary btn-xs"
                       ng-click="changeCommunityStatus(community.objId,true)">开启</a>
                    <a ng-show="community.isValid == true" class="btn btn-danger btn-xs"
                       ng-click="changeCommunityStatus(community.objId,false)">关闭</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="modal fade" id="community_modal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span
                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h5 class="modal-title" id="myModalLabel">{{popupTitle}}</h5>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="backendUserForm">
                    <div class="form-group">
                        <label for="inputLoginId" class="control-label col-xs-2">小区名称:</label>

                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">商品描述:</label>

                        <div class="col-xs-5">
                            <input type="text" class="form-control" ng-model="goods.desc" id="goodsDesc"
                                   required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">库存:</label>

                        <div class="col-xs-5">
                            <input type="text" class="form-control" ng-model="goods.inventory" id="inventory"
                                   required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">商品价格:</label>

                        <div class="col-xs-5">
                            <input type="text" class="form-control" ng-model="goods.price" id="price"
                                   required>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputUserName" class="control-label col-xs-2">商品图片:</label>

                        <div class="col-xs-5">
                            <input type="file" id="pict" required
                                   onchange="angular.element(this).scope().selectFile(this.files)">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button id="saveButton" type="submit" class="btn btn-default"
                                ng-click="saveAdd(goods)">保存
                        </button>
                        <button id="updateButton" type="submit" class="btn btn-default"
                                ng-click="saveUpdate(backendUser.loginId,backendUser)">更新
                        </button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
